package com.aaa.mq;

import com.aaa.config.RabbitMQConfig;
import com.aaa.entity.CReport;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BillMessageSender {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    /**
     * 发送用户添加修改消息
     * @param cReport 参数对象
     */
    public void sendBillSaveUpdateMessage(CReport cReport) {
        rabbitTemplate.convertAndSend(RabbitMQConfig.EXCHANGE_NAME, RabbitMQConfig.ROUTING_SAVE_UPDATE_KEY, cReport);
    }


}
